get analytics root content published
Track daily post publication metrics on TabNews using the MCP TabNews Integration. Analyze content trends and engagement by retrieving post count data.
Instructions
To get how many posts were made (per day) in tabnews
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/status.ts:217-247 (handler)The MCP tool handler for 'get analytics root content published', which calls the service function and formats the response as MCP text content.export const getAnalyticsRootContentPublishedTool = { name: "get analytics root content published", description: "To get how many posts were made (per day) in tabnews", parameters: {}, handler: async (): Promise<McpResponse> => { try { const result = await getAnalyticsRootContentPublished(); const content: McpTextContent = { type: "text", text: `Analytics Root Content Published:\n\n${JSON.stringify( result, null, 2 )}`, }; return { content: [content], }; } catch (error) { if (error instanceof Error) { throw new Error( `Failed to get analytics root content published: ${error.message}` ); } else { throw new Error("Failed to get analytics root content published"); } } }, };
- src/index.ts:66-71 (registration)Registration of the tool in the MCP server using McpServer.tool().server.tool( getAnalyticsRootContentPublishedTool.name, getAnalyticsRootContentPublishedTool.description, getAnalyticsRootContentPublishedTool.parameters, getAnalyticsRootContentPublishedTool.handler );
- src/services/api.ts:92-101 (helper)The core API service function that fetches the analytics root content published data from the TabNews API endpoint.export async function getAnalyticsRootContentPublished(): Promise< AnalyticsRootContentPublished[] > { const response = await fetch( `${TABNEWS_API_URL}/analytics/root-content-published` ); const data = await response.json(); return data as AnalyticsRootContentPublished[]; }
- src/types/index.ts:125-128 (schema)TypeScript interface defining the structure of the analytics root content published data (output schema).export interface AnalyticsRootContentPublished { date: string; conteudos: number; }